function correlationCell = capCC_AVA(itNbr, correlationCell)
% this function limits the maximum local CC 
%
%
%LA - JUL 2019
%
sizeGrid = size(correlationCell);
sizeGather = size(correlationCell{1,1});
correlationCell = cell2mat(correlationCell);

%% limit local CC
if (itNbr == 1)
    correlationCell(correlationCell(:,:)>0.75) = 0.75;
elseif (itNbr == 2)
    correlationCell(correlationCell(:,:)>0.80) = 0.80;
elseif (itNbr == 3)
    correlationCell(correlationCell(:,:)>0.85) = 0.85;
elseif (itNbr == 4)
    correlationCell(correlationCell(:,:)>0.90) = 0.90;
elseif (itNbr == 5)
    correlationCell(correlationCell(:,:)>0.95) = 0.95;
else
    correlationCell(correlationCell(:,:)>0.95) = 0.95;
end
correlationCell = mat2cell(correlationCell, repmat(sizeGather(1),sizeGrid(1),1),  repmat(sizeGather(2),sizeGrid(2),1));

end